package com.yuyou.train.service.api.lesson.service;

import java.util.List;

import com.yuyou.train.service.api.lesson.entity.Lesson;
import com.yuyou.train.service.api.lesson.entity.LessonClass;
import com.yuyou.train.service.api.lesson.entity.LessonClassUserRelation;
import com.yuyou.train.service.api.lesson.entity.LessonResourceRuleFrame;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.yuyou.train.service.api.lesson.entity.LessonResourceRuleRelation;





@FeignClient(value = "train-lesson-service")
@RequestMapping(value = "/lessonAPI")
public interface LessonAPI {
	
	@RequestMapping(value = "/findLesResRuleRel")
	List<LessonResourceRuleRelation> findLesResRuleRel(@RequestBody LessonResourceRuleRelation record);
	
	@RequestMapping(value = "/findLessonClassByUserId")
	List<LessonClass> findLessonClassByUserId(@RequestParam("userId")String userId);
	
	@RequestMapping(value = "/selectLessonRelByLessonId")
	LessonResourceRuleRelation selectLessonRelByLessonId(@RequestParam("lessonId") String lessonId);
	
	@RequestMapping(value = "/selectLessonById")
	Lesson selectLessonById(@RequestParam("id") String id);
	
	@RequestMapping(value = "/findByParentId")
	List<Lesson> findByParentId(@RequestParam("parentId") String parentId);
	
	@RequestMapping(value = "/findSubjectLesson")
	List<Lesson> findSubjectLesson(@RequestParam("lessonClassId") String lessonClassId,	@RequestParam("subjectId") String subjectId);
	
	/**
	 * 查出剩下要学什么课程
	 * @param lessonClassId
	 * @param subjectId
	 * @param sort
	 * @return
	 */
	@RequestMapping(value = "/findLessLesson")
	List<Lesson> findLessLesson(@RequestParam("lessonClassId") String lessonClassId,@RequestParam("subjectId") String subjectId,@RequestParam("sort") Long sort);

	@RequestMapping(value = "/findLessonClassById")
	LessonClass findLessonClassById(@RequestParam("id")String id);

	@RequestMapping(value = "/findLessonClassByCode")
	LessonClass findLessonClassByCode(@RequestParam("code")String code);

	@RequestMapping(value = "/findLesClsUseRelByClassId")
	List<LessonClassUserRelation> findLesClsUseRelByClassId(
			@RequestParam("classId")String classId,
			@RequestParam("type")String type);
	
	@RequestMapping(value = "/selectLesClsUseRel")
	LessonClassUserRelation selectLesClsUseRel(
			@RequestParam("classId")String classId,
			@RequestParam("userId")String userId,
			@RequestParam("type")String type);
	
	@RequestMapping(value = "/findTeacherClass")
	List<LessonClassUserRelation> findTeacherClass(
			@RequestParam("userId")String userId);
	
	@RequestMapping(value = "/findFrameByLessonId")
	List<LessonResourceRuleFrame> findFrameByLessonId(@RequestParam("lessonId") String lessonId);

	@RequestMapping(value = "/selectLastFinishClass")
	LessonClass selectLastFinishClass(@RequestParam("lessonId") String userId);
	
}
